/*
 * An interface for meassuaring the performance (amount of space taken by the file and it's access average) of a single file in a file system.
 */


#ifndef SINGLEFILEPREF_H
#define SINGLEFILEPREF_H

#include "fileperf.hh"
#include <vector>

class SingleFilePref {
protected:
	//Constants:
	const int SUCCESS;
	const int FAILURE;

	//Data members:
	unsigned int _maximalSize;
	unsigned int _blockSize;
	unsigned int _pointerSize;
	unsigned int _blockPtrRatio;

public:
	//Functions:

	//default constructor:
	virtual ~SingleFilePref(){};

	//constructor:
	SingleFilePref(unsigned int maximalSize, unsigned int blockSize,
			unsigned int pointerSize): SUCCESS(0),FAILURE(-1),_maximalSize(maximalSize),
			_blockSize(blockSize),_pointerSize(pointerSize), _blockPtrRatio(blockSize/pointerSize) {};

	//Checks whether a file with the maximal size can be stored in the file system.
	//Returns true if a file with the _maximalSize can be stored, false otherwise.
	virtual int areConstraintsPossilble() = 0;

	//Measures the amount of space taken by the file in the file system and the average number of blocks needed to access it's bytes.
	//The result is assigned to the output structure given as a parameter.
	virtual int singleFileSystemPerformance(unsigned int fileSize,outputStruct *output) = 0;



};
#endif
